import { useRoutes } from "react-router-dom";

import Home from '@/pages/home/home'
import Admin from '@/pages/admin/admin'
import UsLogin from '@/pages/usLogin/usLogin'
import Commodity from '@/pages/commodity/commodity'
import Category from '@/pages/commodity/category/category'


export const routes = [
    {
        path: "",
        exact: true,
        element: <UsLogin />
    },
    {
        path: "/us-login",
        exact: true,
        element: <UsLogin />
    },
    {
        path: "/admin",
        element: <Admin />,
        exact: true,
        children: [
            {
                path: "/admin",
                title: "首页",
                element: <Home />,
            },
            {
                path: "/admin/commodity",
                title: "商品",
                element: <Commodity />,
                children: [
                    {
                        path: "/admin/commodity/",
                        title: "品类管理",
                        element: <Category/>
                    },
                    {
                        path: "/admin/commodity/management",
                        title: "商品管理",
                        element: <h1>商品管理</h1>
                    }
                ]
            },
            {
                path: "/admin/user-Management",
                title: "用户管理",
                element: <div>用户管理</div>,
            },
            {
                path: "/admin/role-management",
                title: "角色管理",
                element: <div>角色管理</div>,
            },
            {
                path: "/admin/chart",
                title: "图形图表",
                element: <div>图形图表</div>,
                children: [
                    {
                        path: "/admin/chart/bzd",
                        title: "6666",
                        element: <h1>bzd</h1>
                    }
                ]
            },
        ]
    }
]
const Routes = () => useRoutes(routes)
export default Routes
